<?php include $this->header();?>
<?php if(false) {?>
<link rel="stylesheet" rev="stylesheet" href="../../../images/admincp/style.css" type="text/css" media="all" />
<?php }?>
<?php foreach($appsInfo as $package => $rs) {?>
<div class="p1 mt bd bg">
  <table class="list rank" width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr class="th">
      <td width="180" align="center"><?php if($package=='core') {?>核心<?php } elseif($package=='option') {?>可选<?php }else {?>其他<?php }?>应用</td>
      <td align="center">简介</td>
      <td width="80" align="center">作者</td>
      <td width="80" align="center">版本</td>
      <td width="160" align="center">管理操作</td>
    </tr>
    <?php foreach($rs as $app => $r) { ?>
<tr>
      <td align="left">&nbsp;<?=$r['app_name']?> (<?=$r['app_id']?>)</td>
      <td align="left">&nbsp;<?=$r['app_desc']?></td>
      <td align="center">&nbsp;<?=$r['app_author']?></td>
      <td align="center">&nbsp;<?=$r['app_version']?></td>
      <td align="center">&nbsp;
	    <?php if($r['app_installed']) {?>
        [<a href="<?=UE_Url::make('system/app/aclsetting/'.$r['app_id'])?>">权限设置</a>]
        <?php } ?>
        
	    <?php if($package == 'core') {?>
          <?php if($r['app_installed']) {?>
          <span class="gray">[禁用] [卸载]</span>
          <?php } else { ?>
          [<a href="<?=UE_Url::make('system/app/install/'.$r['app_id'])?>">安装</a>] <span class="gray">[删除]</span>
          <?php } ?>
        <?php } else {?>
	    <?php if(empty($r['app_err'])) {?>
	    <?php if($r['app_installed']) {?>
        <?php if($r['app_activated']) {?>
        [<a href="<?=UE_Url::make('system/app/deactivate/'.$r['app_id'])?>">禁用</a>]
        <?php } else {?>
        [<a href="<?=UE_Url::make('system/app/activate/'.$r['app_id'])?>" class="red">启用</a>]
        <?php } ?>
        [<a href="<?=UE_Url::make('system/app/uninstall/'.$r['app_id'])?>" onclick="return confirm('确定要卸载该应用吗？一旦卸载，该应用的所有数据将被删除。')">卸载</a>]
		<?php } else {?>
        [<a href="<?=UE_Url::make('system/app/install/'.$r['app_id'])?>">安装</a>] 
        [<a href="<?=UE_Url::make('system/app/del/'.$r['app_id'])?>" onclick="return confirm('确定要删除该应用吗？一旦删除，该应用的所有文件将被删除。')">删除</a>]
		<?php }} else {?>
        [<a href="<?=UE_Url::make('system/app/del/'.$r['app_id'])?>" onclick="return confirm('确定要删除该应用吗？一旦删除，该应用的所有文件将被删除。')">删除</a>]
        <?php } ?>
        <?php } ?>
      </td>
    </tr>
     <?php } ?>
  </table>
</div>
<?php } ?>

<?php include $this->footer();?>